package cloudInformation.service.impl;

import cloudEntity.dto.user.SmartUserRelaxDetailsDTO;
import cloudEntity.entity.SmartUserRelaxDetailsEntity;
import cloudInformation.covert.SmartRelaxDetailsCovertInterFace;
import cloudInformation.mapper.SmartUserRelaxDetailsMapper;
import cloudInformation.service.SmartUserRelaxDetailsService;
import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: Smart School
 * @ClassName SmartUserRelaxDetailsServiceImpl
 * @description:
 * @author: 陈智博
 * @create: 2025-04-14 08:31
 * @Version 1.0
 **/
@Service
public class SmartUserRelaxDetailsServiceImpl implements SmartUserRelaxDetailsService {

    @Autowired
    private SmartUserRelaxDetailsMapper smartUserRelaxDetailsMapper;

    @Override
    public Integer createRelax(SmartUserRelaxDetailsDTO dto) {
        SmartUserRelaxDetailsEntity converEntity = SmartRelaxDetailsCovertInterFace.INSTANCE.toConverEntity(dto);
        converEntity.setSysUserRelaxCreateTime(DateUtil.date());
        return smartUserRelaxDetailsMapper.createUserRelaxDetails(converEntity);
    }
}
